import random
repeating = True
while repeating:
    found_repeating = False
    guess = str(random.randint(1000,9999))
    for i  in range(0,len(guess) - 1):
        if guess[i] in guess[i+1:]:
            found_repeating = True
            print("repeating number [" + guess[i] + "] in : " + guess[i+1:])
    repeating = found_repeating
from_user = input("guess : ")
while from_user != guess:
    bulls_c = 0
    cows_c = 0
    for j in range(0,len(from_user)):
        if from_user[j] == guess[j]:
            bulls_c += 1
        elif from_user[j] in guess:
            cows_c += 1
    print( str (bulls_c) + " bulls , " + str(cows_c) + " cows")
    from_user = input("guess : ")
print("guess was : " + guess)